package com.cj.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

@SuppressWarnings("serial")
public class PostSalary extends Model<PostSalary> {
	public static final PostSalary me = new PostSalary();
	
	 public PostSalary getPostSalaryByPost(Integer id) {
			String sql = "select * from postsalary where postId = ?";
			return findFirst(sql, id);
	}
	 
	 public List<PostSalary> getAllPostSalary() {
		 String sql = "select * from postsalary s left join post p "
	    			+ "on s.postId = p.postId left join department d "
	    			+ "on p.deptId = d.deptId";
		 return find(sql);
	 }
}
